package cn.geracomium.action;

import cn.geracomium.util.action.AbstractAction;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class GlobalAction extends AbstractAction {

    @RequestMapping("/error")
    public ModelAndView error() {
        ModelAndView mav = new ModelAndView("pages/common/errors");
        super.setUrlMsg(mav, "error.msg");
        return mav;
    }

    @RequestMapping("/errors")
    public ModelAndView errors() {
        ModelAndView mav = new ModelAndView("pages/common/back_forward");
        super.setUrlMsg(mav, "errors.msg");
        return mav;
    }

    @RequestMapping("/forward")
    public String forward() {
        return "pages/common/back_forward";
    }

    @RequestMapping("/unauthz")
    public String unauthz() {
        return "pages/common/unauthz";
    }

    @RequestMapping("/logoutInfo")
    public ModelAndView logoutInf() {
        ModelAndView mav = new ModelAndView("pages/common/back_forward");
        super.setUrlMsg(mav, "logout.success");
        return mav;
    }
}
